<?php
namespace Admin\Controller;
use Admin\Controller\BaseController;
class ManagerController extends BaseController {
	/*
	 *显示网站权限管理页面基本信息
	 */
    public function index(){
    	//管理员展示信息（显示5条，按登录的时间排序显示）
    	$sql="select a.*,b.role_name from y_admin_member a left JOIN y_admin_role b on a.role_id = b.id  order by id desc limit 0,5";
    	$M = M();
    	$admin_member=$M->query($sql);
    	$this->assign("admin_member",$admin_member);
    	//角色展示信息（显示5条）
    	$sql="select * from y_admin_role limit 0,5";
    	$role_info=$M->query($sql);
    	$this->assign("role_info",$role_info);
    	//登录日志展示（显示5条）
    	$sql="select * from y_admin_log a,y_admin_member b where a.admin_id=b.id order by log_time desc limit 0,5";
    	$log_info=$M->query($sql);
    	$this->assign("log_info",$log_info);
        
        //提取出遍历所有的子节点
        session_start();
        $id=I("get.");
        $id=$id["id"];
        $_SESSION["pid"]=$id;
        $id=$_SESSION["pid"];
        $M=M("admin_node");
        $node=$M->where("parent_id='$id'")->select();
        $_SESSION["node"]=$node;
        $this->display();
    }
    public function redirect(){
    redirect(U("Manager/index"),0,"页面跳转中···");
    }
}

